<?php
//internal page data used to redirect the user and determine which templates to use.
$page_data['action'] = null;
$page_data['redir'] = null;

$body_class = 'jTalkBody';
$chat_default = "Type your message here!";

//meta data - pulled from the database and populated server-side.
$meta['TITLE'] = 'jTalk : A free JavaScript based chat app.';
$meta['DATE'] = 'May 27, 2010';
$meta['AUTHOR'] = 'Chad Park Vincent';
$meta['CONTACT'] = 'chad.park.vincent@gmail.com';
$meta['DETAILS'] = 'A barebones jQuery based chat app. It must perform basic chat functions. Not too complicated and fully JS driven on the front end. For this exercise we will be using PHP and MySQL as the backend. With that in mind, let\'s quickly make up some func specs:
	            <ul class="squareList padL2em padTB1em">
	                <li><span class="strong">"Pull" not "Push".</span> This is a "pull" app. Pushlets are truer and more dynamic but this will not be a pushlet. The purpose of this is to show a barebones chat app. Another common method is to have server-side triggered DOM events which sets off the Ajax requests, but again for the sake of this exercise we\'re not doing that. Instead, the client will update when sending a message, and simply poll the server for new messages at regular intervals.</li>
	                <li><span class="strong">Send message.</span> Clients must be able to send messages to other users.</li>
	                <li><span class="strong">Receive message.</span> Clients must be able to receive messages from other users.</li>
	                <li><span class="strong">Gabagool.</span> We must has it.</li>
	            </ul>
	            If your heart so desires, you can further improve the app with enhancements, such as persistent user data like profiles, with login/logout, private messaging, friends lists, emoticons, and so forth. You get the idea. Most of these are fairly simple to implement, but I\'m not going to do it here. In the future in another article I will revisit this and expand on what we\'ve created here with some new features. But for now let\'s just get the chat up and running. Let\'s get started!';
$meta['DEFAULT_STATE'] = 'collapsed';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<title>jqTalk. A free jQuery based chat application.</title>
	<? include $_SERVER['DOCUMENT_ROOT'] . '/../templates/global/head.php'; ?>
	<script type="text/javascript">
	var page_data = {
		default_msg: '<? echo $chat_default; ?>',
		default_meta_state: '<? echo $meta['DEFAULT_STATE']; ?>'
	};
	</script>
</head>

<body class="<? echo $body_class; ?>">

<!-- main -->
<div class="main">
	
	<!-- No JS Error -->
	<noscript>
		<div id="alert-nojs-error" class="alertErrorTxt">
			<table border="0" cellpadding="0" cellspacing="0">
				<tr>
					<td valign="middle"><div class="alertErrorIcon"></div></td>
					<td><p>You must enable <code>JavaScript</code> before you can use this application. You can do this by enabling <code>JavaScript</code> in your browser's settings window and then reloading the page. If your browser does not support <code>JavaScript</code>, tough shit buddy.</p></td>
				</tr>
			</table>
		</div>
	</noscript>
	<!-- /No JS Error -->
	<!-- Browser Error -->
	<div id="alert-browser-error" class="alertErrorTxt">
		<table border="0" cellpadding="0" cellspacing="0">
			<tr>
				<td valign="middle"><div class="alertErrorIcon"></div></td>
				<td><p>This app works best with Firefox 3, Firefox 3.6, Safari 4, Internet Explorer 7 or 8. Specifically, I did not give a shit about Internet Explorer 6 when I made this. If you're using IE6, I suggest you switch to newer, less-shitty browser before trying to use this site.</p></td>
			</tr>
		</table>
	</div>
	<!-- /Browser Error -->

	<h1 class="letterspace2 mainLogo">jTalk : an experimental javascript chat web app!</h1>
	<? include $_SERVER['DOCUMENT_ROOT'] . '/../templates/global/modules/jump-menu.php'; ?>
	<? include $_SERVER['DOCUMENT_ROOT'] . '/../templates/global/modules/meta.php'; ?>
    <!-- main:content -->
    <div class="content">
    	<? include $_SERVER['DOCUMENT_ROOT'] . '/../templates/global/modules/jtalk-pane.php'; ?>
    </div>
    <!-- /main:content -->
    
</div>
<!-- /main -->

<? include $_SERVER['DOCUMENT_ROOT'] . '/../templates/global/footer.php'; ?>

</body>
</html>